package com.flyou.consumer.config;

import com.flyou.consumer.client.UserFeginClient;
import com.flyou.consumer.pojo.User;
import org.springframework.stereotype.Component;

/**
 * @ClassName FeignFallback.java
 * @author fzl
 * @version 1.0.0
 * @Description 服务降级或者熔断后返回的处理结果
 * 一般返回BaseResult<T>，这里为了方便演示统一返回User
 * @createTime 2022/2/10 14:31
 */
@Component
public class FeignFallback implements UserFeginClient {
    @Override
    public User findUserById(Long id) {
        User user=new User();
        user.setUserName("请求失败了");
        return user;
    }
}
